package com.zzl.constructor;

/**
 * 测试构造函数，
 * 构造函数是用来造唯一的东西，所以构造函数不能被继承和重写
 * @author Administrator
 *
 */
public class TestConstructor {
	public static void main(String[] args) {
		
	}

}

class Father{
	public Father(){
		System.out.println("Father Constructor");
	}
	public Father(int x){
		System.out.println("Father Constructor " + x);
	}
	public void father(){
		System.out.println("Father member function");    
	}
}

class Son extends Father{
	public Son(){
		super(1);
		System.out.println("Son Constructor");
	}
	
	public void father(){
		System.out.println("Inherited Father member function.");    
		super.father();
	}
}
